package com.blue.base.oauth.server.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.security.Principal;

/**
 * @author liulei
 * @version 1.0
 */
@Slf4j
@Controller
public class SsoController {

    // sso访问用户接口：user-info-uri
    @ResponseBody
    @GetMapping("/oauth/user")
    public Principal user(Principal principal) {
        log.info("获取用户信息:{}", principal.toString());
        return principal;
    }
}
